PROJECTENGRAM

JAVASCRIPT

Javascript

Tags: #◇Web Development #◇CCAPDEV #◇Javascript #◇Code Snippets #◇M3


◇Overview

Extracted notes for Javascript covering both theoretical and practical elements.

◇Key Definitions

JavaScript Programming language that is used for web development Designed to add interactivity to HTML pages is multi-paradigm, as it supports object-oriented, imperative, and declarative styles.
JavaScript Accept Input Text fields, checkboxes, buttons, etc. Process Data Make decisions, manipulate variables Modify Pages on the Fly Change text, replace mages, special effects Manipulate Windows Open windows, write to them, close them
External JS Best used to control multiple web pages. type – specifies the media type of the linked document (common values include text/css and text/javascript

◇Code Implementation

『』
TEXT
JavaScript
Attaching JavaScript to your webpage
External – Separate file
Internal – Embedded in <head> and/or in <body>
Inline – Placed inside HTML element tags as attributes
『』
TEXT
JavaScript
Scripts in the <head> section will be processed first before the page loads
Scripts in the <body> section will execute when the page loads
You can place an unlimited number of scripts in your document, so you can have scripts in both the <head> and the <body> section
Scripts you want to be called later should be in a function
『』
TEXT
External JS
A separate .js file connected using a <script> element inside the <head> and/or <body> element of the HTML.
<head>
	<title> Sample Title </title>
	<script src=“external.js”></script>
</head>
『』
TEXT
External JS
A separate .js file connected using a <script> element inside the <head> and/or <body> element of the HTML.
<body>
	<script src=“external.js”></script>
</body>
『』
TEXT
External JS
Best used to control multiple web pages.
<script src=“external.js”></script>
src – specifies the URI of an external script file

◇Syntax Breakdown

Ensure correct syntax for Javascript Pay attention to specific functions and declarations.

◇Complexity Analysis

Time Complexity: O(1) for typical operations unless looping. Space Complexity: O(1) generally.

◇References & Navigation

CONFIRMATION // 理解度の確認

ACTIVE RECALL VERIFICATION

Select an answer to verify conceptual comprehension and reveal the technical rationale.

Q1

Where should scripts be placed if you want them to be processed before the page loads?

Q2

Which of the following is an advantage of using an External JavaScript file over inline scripts?

Q3

Which HTML attribute is used within a <script> tag to specify the URI of an external script file?